<?php

declare(strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

/**
 *  账户绑定日志
 */
class WithdrawAccountLog extends Model
{
    protected $table = 'withdraw_account_log';

    /**
     * 添加记录
     */
    static function addRecord($userId = 0, $op = 1, $account = '', $accountType = -1)
    {
        $model = new self();
        $model->user_id = $userId;
        $model->bind_op = $op;
        $account && $model->account = $account;
        $accountType > -1 && $model->account_type = $accountType;
        return $model->saveOrFail() ? 1 : 0;
    }
}
